package com.aaa.mapper;

import com.aaa.entity.Comment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Bean
 * @since 2021-09-07
 */
public interface CommentMapper extends BaseMapper<Comment> {
    //一级评论
    List<Map<String,Object>> selecomment(@Param("vid") Integer vid,@Param("uid") Integer uid);
    //二级评论
    List<Map<String,Object>> reply_comment(@Param("vid") Integer vid,@Param("id") Integer id,@Param("uid") Integer uid);


    //根据作品id查询作者
    String seleuid(Integer vid);
    //根据作品id修改状态
    Integer updastate(@Param("id") Integer id,@Param("state") Integer state);
    //添加一级评论
    Integer addtop(@Param("uid")Integer uid,@Param("uname") String uname,@Param("vid")Integer vid,@Param("content")String content,@Param("state") Integer state);

    //添加二级评论
    Integer addtwo(@Param("uid") Integer uid,@Param("uname") String uname,@Param("vid") Integer vid,@Param("parentid") Integer parentid,@Param("content") String content,@Param("state") Integer state);

    //回复二级评论
    Integer addtworeply(Comment comment);

}
